Image processing apparatus, printing apparatus, image processing method, and image processing program

ABSTRACT

An image is divided into first a second regions on the basis of inputted image data, and a comparison is made between the gradation values of pixels in the first region and threshold values corresponding to the pixels of the first region of a dither mask. The results of the comparison are referenced to determine whether or not dots are formed in the pixels of the first region. Errors are calculated based on the results of determining the first boundary pixels, which are in the first region near the boundary between the first region second regions. Some of the errors are distributed as diffusion errors to pixels in the second region near the boundary. The diffusion errors distributed from the first boundary pixels are added, and it is determined whether or not dots are formed by the error diffusion method in the pixels of the second region.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Japanese Patent Application No.2011-066008 filed on Mar. 24, 2011. The entire disclosure of JapanesePatent Application No. 2011-066008 is hereby incorporated herein byreference.

BACKGROUND Technological Field

The present invention relates to a printing technique for printing imagedata that expresses a predetermined image and, more specifically, to atechnique for generating dot data that expresses whether or not dots areformed.

BACKGROUND TECHNOLOGY

The dither method and error diffusion method are widely known as thetechniques (referred to below as halftone techniques) used in printingapparatus to express gradation in images using expression methods thathave less gradation than the original image. Because the dither methodand the error diffusion method both have merits and drawbacks, ahalftone process has long been desired in which the dither method iscombined with the error diffusion method. For example, techniques havebeen disclosed in Patent Citations 1 and 2 in which a halftone processis performed that combines a dither method element and an errordiffusion method element by using a threshold value in the dither maskas a threshold value in the error diffusion method and by periodicallychanging the threshold value. However, in these halftone processtechniques, image processing cannot be performed appropriately in imageshaving predetermined characteristics.

Japanese Laid-open Patent Publication No. 2001-292320 (PatentDocument 1) and Japanese Laid-open Patent Publication No. 5-122510(Patent Document 2) are examples of the related art.

SUMMARY Problems to be Solved by the Invention

An advantage of the invention is to provide a technique forappropriately performing image processing which incorporates the dithermethod and the error diffusion method.

Means Used to Solve the Above-Mentioned Problems

An advantage of the invention is to solve the above-mentioned problem byproviding a technique for appropriately performing image processingwhich incorporates the dither method and the error diffusion method.

Application Example 1

An image processing apparatus for processing image data having aplurality of pixels and expressing an image using a gradation value foreach pixel, wherein the image processing apparatus includes: an inputunit for inputting the image data; a region-dividing processor fordividing the image into at least a first region and a second region onthe basis of the inputted image data; a comparator for comparinggradation values of pixels in the first region and threshold valuescorresponding to the pixels of the first region of a dither mask havinga plurality of threshold values; a first dot-decision processor fordeciding whether or not dots are formed in pixels of the first regionamong first boundary pixels, which are pixels in the first region nearthe boundary between the first region and the second region, usinginformation on pixels included in the first region and not usinginformation on pixels included in the second region; a seconddot-decision processor for deciding whether or not dots are formed inpixels of the second region among some of the pixels in the secondregion, using information on pixels included in the first region andinformation on pixels included in the second region; and a dot datagenerator for generating dot data for the image data using formation ornon-formation of dots as decided by the first and second dot-decisionprocessors.

In this image processing apparatus, separate image-processing elementscan be applied to the first region and the second region. Switchingbetween the two regions having different image-processing elements canbe performed smoothly because the image processing performed in thefirst region does not affect the second region, and the image processingperformed in the second region is affected by the first region.

Application Example 2

The image processing apparatus of Application Example 1, wherein thefirst dot-decision processor adds the diffusion errors distributed fromthe processed pixels near the first boundary pixels to the gradationvalues of the first boundary pixels, calculates the first correctedgradation values, and references at least the comparison results todecide whether or not dots are formed in pixels of the first region, andthen calculates errors between the first corrected gradation values andthe first decision result values, which are values corresponding todensity expressed by the pixels in the results of decisions among thefirst boundary pixels, and distributes the errors as diffusion errors tounprocessed pixels near the first boundary pixels.

In this image processing apparatus, it is possible to appropriatelygenerate dot data in which the first boundary pixels combine ditheringelements with error diffusion elements. As image processing in which thedither method and the error diffusion method are combined, this can moreaccurately reflect the characteristics of the dither mask in comparisonwith a case in which the error diffusion method is performed using thethreshold values of the dither mask; that is, compared with a case inwhich the error diffusion method is performed so as to compare thethreshold values of the dither mask with corrected gradation values inwhich the gradation values of the pixels have been corrected usingdiffusion errors.

Application Example 3

The image processing apparatus of Application Example 1, wherein thesecond dot-decision processor calculates second corrected gradationvalues in which diffusion errors distributed from processed pixels amongsome of the pixels in the second region in an adjacent area thatincludes the first boundary pixels have been added to the gradationvalues of the pixels, compares the second corrected gradation values anda predetermined threshold value to calculate the second correctedgradation values, compares the second corrected gradation values and apredetermined threshold value to decide whether or not dots are formed,calculates errors between the second corrected gradation values andsecond decision result values, which are values corresponding to densityexpressed by the pixels in the results of the decisions, and distributesthe errors as diffusion errors to pixels in an adjacent area.

In this image processing apparatus, switching the image-processingelements from the first region to the second region is performedsmoothly because some of the pixels in the second region have errordiffusion elements in which information on the pixels in the firstregion is also taken into account.

Application Example 2

The image processing apparatus of Application Example 1, wherein theregion-dividing processor divides the image that comprises the pluralityof pixels so that the region that satisfies predetermined conditions fora region suitable for processing by the dither method becomes the firstregion, and the region that satisfies predetermined conditions for aregion suitable for processing by the error diffusion method becomes thesecond region.

In the image processing apparatus, image processing can be performedappropriately on a region that satisfies predetermined conditions for aregion suitable for processing by the dither method, and a region thatsatisfies predetermined conditions for a region suitable for processingby the error diffusion method.

Application Example 3

The image processing apparatus of Application Example 1 or 2, whereinthe hist dot-decision processor decides, as a result of the comparison,that dots are formed in cases in which the gradation value of a pixel inthe first region is greater than the threshold value corresponding to apixel in the first region of the dither mask, and that dots have notbeen formed in cases in which the gradation value is less than thethreshold value.

In this image processing apparatus, a process is performed to decide, asa result of the comparison, that dots are formed in cases in which thegradation value of a pixel in the first region is greater than thethreshold value corresponding to a pixel in the first region of thedither mask, and dots have not been formed in cases in which thegradation value is less than the threshold value. Therefore, thecharacteristics of the dither mask can be sufficiently reflected in thegeneration of dot data.

Application Example 4

The image processing apparatus of Application Example 1 or 2, whereinthe first dot-decision processor compares a predetermined determinationvalue and third corrected gradation values in which diffusion errorsdistributed from processed pixels among some of the pixels in an areaadjacent to the first region have been added to the gradation values ofthe pixels, and decides whether or not dots are formed, and, as a resultof the comparison by the comparator, adjusts the determination valueswithin a predetermined width so that the determination value applied incases in which the gradation value of a pixel in the first region isgreater than the threshold value corresponding to a pixel in the firstregion of the dither mask does not exceed the determination valueapplied in cases in which the gradation value of a pixel in the firstregion is equal to or less than the threshold value corresponding to apixel in the first region of the dither mask.

In this information processing apparatus, a dot pattern in which errordiffusion elements (for example, excellent dot dispersibility andcontinuity characteristics) or dithering elements have been enhanced canbe generated in the first region, depending on how the determinationvalues have been adjusted. Therefore, images can be appropriateprocessed by adjusting the determination values and adjusting thestrength of the error diffusion elements and dithering elements,depending on the characteristics of the image data to be printed.

Application Example 5

The image processing apparatus of any of Application Examples 1 through4, wherein the second dot-decision processor decides whether or not dotsare formed by the error diffusion method, using an error diffusionthreshold value prepared in advance as a threshold value used in theerror diffusion method.

In this image processing apparatus, whether or not dots are formed inthe second region can be decided using the commonly used error diffusionmethod; that is, using the error diffusion method in which an errordiffusion threshold value prepared in advance is used.

Application Example 6

The image processing apparatus of any of Application Examples 1 through5, wherein the first region is a region composed of pixels without edgepixels, the edge pixels being pixels constituting an edge havinggradation value whose difference with respect to an adjacent pixel isequal to or greater than a predetermined value, and wherein the secondregion is a region composed of the edge pixels.

In this image processing apparatus, it is determined whether or not dotsare formed using the error diffusion method in the edge pixels.Therefore, when printing is performed using the generated dot data, aprinted image can be obtained having superior edge reproducibility.

Application Example 7

The image processing apparatus of any of Application Examples 1 through5, wherein the second region is a thin-line or character region includedin an image.

When printing is performed using dot data generated by this imageprocessing apparatus, a printed image can be obtained having superiorline and character reproduction.

Application Example 8

The image processing apparatus of any of Application Examples 1 through5, wherein the first region is a region composed of inner pixels, whichare pixels other than outer edge pixels constituting an outer edge of aline drawing, among the pixels constituting the line drawing included inthe image, and wherein the second region is a region composed of theouter edge pixels.

When printing is performed using dot data generated by this imageprocessing apparatus, a printed image can be obtained in which a linedrawing has superior contour reproducibility.

Application Example 10

The image processing apparatus of any of Application Examples 1 through5, wherein the first region is a region having less noise inhigh-frequency components than a predetermined value, and wherein thesecond region is a region having more noise in the high-frequencycomponents than the predetermined value.

When printing is performed using dot data generated by this imageprocessing apparatus, deterioration of the printed image due tointerference caused by the periodicity of the dither mask in regionshaving a large amount of high-frequency components can be inhibited.

Application Example 11

A printing apparatus for performing a printing operation on the basis ofimage data having a plurality of pixels and expressing an image using agradation value for each pixel, wherein the printing apparatus includes:an input unit for inputting the image data; a region-dividing processorfor dividing the image into at least a first region and a second regionon the basis of the inputted image data; a comparator for comparinggradation values of pixels in the first region and threshold valuescorresponding to the pixels of the first region of a dither mask havinga plurality of threshold values; a first dot-decision processor foradding the diffusion errors distributed from processed pixels near thefirst boundary pixels to the gradation values of the first boundarypixels in the first boundary pixels, which are pixels in the firstregion near the boundary between the first region and the second region,calculating the first corrected gradation values, and referencing atleast the comparison results to decide whether or not dots are formed inpixels of the first region, and then calculating errors between thefirst corrected gradation values and the first decision result values,which are values corresponding to density expressed by the pixels in theresults of decisions among the first boundary pixels, and distributingthe errors as diffusion errors to unprocessed pixels near the firstboundary pixels; a second dot-decision processor for calculating secondcorrected gradation values in which diffusion errors distributed fromprocessed pixels among some of the pixels in the second region in anadjacent area that includes the first boundary pixels have been added tothe gradation values of the pixels, comparing the second correctedgradation values and a predetermined threshold value to decide whetheror not dots are formed, calculating errors between the second correctedgradation values and second decision result values, which are valuescorresponding to density expressed by the pixels in the results of thedecisions, and distributing the errors as diffusion errors to pixels inan adjacent area; a dot data generator for generating dot data for theimage data using formation or non-formation of dots as decided by thefirst and second dot-decision processors; and a printing unit forperforming a printing operation on the basis of the dot data.

This printing apparatus can switch smoothly between image processing inthe first region and image processing in the second region, and dot datacombining dithering elements and error diffusion elements can beappropriately generated and printed. Also, this printing apparatusdecides whether or not dots are formed using the results of a comparisonof the gradation values of the first boundary pixels and the thresholdvalue of the dither mask. Thus, as image processing in which the dithermethod and the error diffusion method are combined, this arrangementmakes it possible to more accurately reflect the characteristics of thedither mask in comparison with a case in which the error diffusionmethod is performed using the threshold values of the dither mask.

Application Example 12

An image processing method for processing image data having a pluralityof pixels and expressing an image using a gradation value for eachpixel, the image processing method including the steps of: inputting theimage data; dividing the image into at least a first region and a secondregion on the basis of the inputted image data; comparing gradationvalues of pixels in the first region and threshold values correspondingto the pixels of the first region of a dither mask having a plurality ofthreshold values; adding the diffusion errors distributed from processedpixels near the first boundary pixels to the gradation values of thefirst boundary pixels in the first boundary pixels, which are pixels inthe first region near the boundary between the first region and thesecond region, calculating the first corrected gradation values, andreferencing at least the comparison results to decide whether or notdots are formed in pixels of the first region, and then calculatingerrors between the first corrected gradation values and the firstdecision result values, which are values corresponding to densityexpressed by the pixels in the results of decisions among the firstboundary pixels, and distributing the errors as diffusion errors tounprocessed pixels near the first boundary pixels; calculating secondcorrected gradation values in which diffusion errors distributed fromprocessed pixels among some of the pixels in the second region in anadjacent area that includes the first boundary pixels have been added tothe gradation values of the pixels, comparing the second correctedgradation values and a predetermined threshold value to decide whetheror not dots are formed, calculating errors between the second correctedgradation values and second decision result values, which are valuescorresponding to density expressed by the pixels in the results of thedecisions, and distributing the errors as diffusion errors to pixels inan adjacent area; and generating dot data for the image data usingformation or non-formation of dots as decided by the first and seconddot-decision processors.

This image processing method can switch smoothly between imageprocessing in the first region and image processing in the secondregion, and dot data combining dithering elements and error diffusionelements can be generated. Also, it is decided with this imageprocessing method whether or not dots are formed, using the results of acomparison of the gradation values of the first boundary pixels and thethreshold values of the dither mask. Thus, as image processing in whichthe dither method and the error diffusion method are combined, thisarrangement makes it possible to more accurately reflect thecharacteristics of the dither mask in comparison with a case in whichthe error diffusion method is performed using the threshold values ofthe dither mask.

In addition to a configuration as an image processing apparatus, theinvention can be realized as a printing data generating apparatus, aprinting method for printing with a printing apparatus, a printingprogram, and a recording medium for recording this program.

BRIEF DESCRIPTION OF THE DRAWINGS

Referring now to the attached drawings which form a part of thisoriginal disclosure:

FIG. 1 is a schematic block diagram of a printer 20;

FIG. 2 is a flowchart showing the flow of the printing process;

FIG. 3 is a flowchart showing the flow of the halftone process;

FIG. 4 is an explanatory diagram used to explain the regiondetermination process (D=1);

FIG. 5 is an explanatory diagram used to explain the regiondetermination process (D=2);

FIG. 6 is a flowchart showing the flow of the dot ON/OFF determinationprocess;

FIG. 7 is an explanatory diagram summarizing the characteristics of thehalftone process;

FIG. 8 is a flowchart showing the flow of the dot ON/OFF determinationprocess in Example 2;

FIG. 9 is an explanatory diagram summarizing the characteristics of thehalftone process in Example 2;

FIG. 10 is an explanatory diagram used to explain the regiondetermination process (D=1) in Modification 3; and

FIG. 11 is an explanatory diagram used to explain the regiondetermination process (D=2) in Modification 3.

DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS A. 1st Example: (A1)Device Configuration:

FIG. 1 is a schematic block diagram of the printer 20 in the firstexample of the invention. The printer 20 is a serial-type inkjet printerfor performing bi-directional printing as described below. As shown inthe drawing, the printer 20 has a mechanism for transporting a printmedium P using a paper feeding motor 74 (the direction of transport isalso referred to below as the sub-scanning direction), a mechanism forreciprocating a carriage 80 in the axial direction of a platen 75 usinga carriage motor 70 (this direction is referred to below as the mainscanning direction), a mechanism for driving a print head 90 mounted inthe carriage 80 to discharge ink and form dots, and a controller 30 forcontrolling the exchange of signals with the paper feeding motor 74, thecarriage motor 70, the print head 90, and a control panel 99.

The mechanism for reciprocating the carriage 80 in the axial directionof the platen 75 has a sliding shaft 73 laid parallel to the shaft ofthe platen 75 and adapted to slidably hold the carriage 80; a pulley 72sharing an endless drive belt 71 with the carriage motor 70; and thelike.

Ink cartridges 82 to 87 containing cyan ink C, magenta ink M, yellow inkY, black ink K, light cyan ink Lc, and light magenta ink Lm are mountedin the carriage 80. A row of nozzles corresponding to the color inksmentioned above are formed in the print head 90 in the bottom portion ofthe carriage 80. When the ink cartridges 82 to 87 have been mounted inthe carriage 80 from above, ink can be supplied to the print head 90from each cartridge.

The controller 30 is composed of a CPU 40, ROM 51, RAM 52, and EEPROM 60connected to each other via a bus. Programs stored in the ROM 51 and theEEPROM 60 are extracted and run in the RAM 52, whereby the controller 30can function as an input unit 41, halftone processor 42, and printingunit 49 in addition to controlling all of the operations of the printer20. The functions of the halftone processor 42 include the functions ofa region-determination processor 43, a dither method processor 44, andan error diffusion method processor 45. These functional units will bedescribed in detail below.

A dither mask 61 is stored in a portion of the EEPROM 60. The dithermask 61 is used in a halftone process performed using the ordered dithermethod. In this example, the dither mask 61 includes a threshold valuedistribution having so-called blue noise characteristics. The term“threshold value distribution having blue noise characteristics” refersto a threshold value distribution in which dots are generated randomlywhen these dots are generated using a dither matrix having such athreshold value distribution, and in which the spatial frequencycomponent of the set threshold values has the largest component in ahigh-frequency region having a period of two pixels or less. The term“threshold value distribution having green noise characteristics”described below refers to a threshold value distribution in which dotsare generated randomly when these dots are generated using a dithermatrix having such threshold value distribution, and in which thespatial frequency component of the set threshold values has the largestcomponent in a mid-frequency region having a period of two pixels toseveral tens of pixels.

Also, in this example, the dither mask 61 has predetermined dotformation characteristics. In other words, the mask has characteristicsthat display good dot dispersibility irrespective whether the result isa dot pattern for a dot group formed by a reciprocating carriage 80 inbi-directional printing, a dot pattern for a dot group formed inmultiple passes, or a dot pattern for all dot groups combining these.This technique is described, for example, in Japanese Laid-open PatentPublication No. 2007-15359. Instead of, or in addition to, providinggood dispersibility to the aforementioned groups obtained in eachreciprocating pass or multiple pass, the dither mask 61 can also providegood dot dispersibility to each main scanning group that indicates whichof a plurality of main scanning operations performed by the carriage 80are the operations that involve dot formation.

Good dot dispersibility can be identified as a dot pattern having bluenoise characteristics or green noise characteristics. It can also beidentified by a positive correlation coefficient between the spatialfrequency distribution of the threshold values for the dither mask setfor the pixels belonging to each one of a plurality of groups and thespatial frequency distribution of the printed image. This correlationcoefficient is preferably 0.7 or greater.

A memory card slot 98 is connected to the controller 30, and image dataORG can be read and inputted from a memory card MC inserted into thememory card slot 98. In this example, the image data ORG inputted fromthe memory card MC is data having three color components: red (R), green(G), and blue (B). Each one of these colors is expressed by an 8-bitgradation value.

In a printer 20 having such a hardware configuration, the print head 90is reciprocated in the main scanning direction with respect to printmedium P by the driving of a carriage motor 70, or and print medium P ismoved in the sub-scanning direction by the driving of a paper feedingmotor 74. The controller 30 forms ink dots of the appropriate color inthe appropriate locations on the print medium P by matching thereciprocating movement of the carriage 80 with the paper feedingmovement of the print medium, and driving the nozzles according to theappropriate timing on the basis of the print data. In this way, theprinter 20 can print a color image inputted from a memory card MC onto aprint medium P.

(A2) Printing Process:

The following is a description of the printing process performed by theprinter 20. FIG. 2 is a flowchart showing the flow of the printingprocess performed by the printer 20. Here, the printing process isinitiated when the user uses a control panel 99 or the like to enter acommand to print a predetermined image stored in a memory card MC. Whenthe printing process has been initiated, the CPU 40 first reads andinputs the RGB-formatted image data ORG to be printed from the memorycard MC via the memory card slot 98 (Step S110) as the processes of theinput unit 41.

When the image data ORG is inputted, the CPU 40 references a lookuptable (not shown) stored in EEPROM 60, and applies color conversion tothe image data ORG to convert the RGB format to a format expressed by C(cyan), M (magenta), Y (yellow), K (black), Lc (light cyan), and Lm(light magenta) (Step S120).

When color conversion is performed, the CPU 40 performs, as a processesof the halftone processor 42, a halftone process in which the image datais converted to dot data representing the dot ON/OFF for each color(Step S130). The halftone process performed here is described in detailbelow. The halftone process is not limited to dot ON/OFF binarization.It can also be a multi-value process, such as ON/OFF for large dots andsmall dots. The image data provided in Step S130 can also be processedas an image by performing other processes such as resolution conversionor smoothing.

When the halftone process is performed, the CPU 40 matches the nozzleposition of the printer 20 with the amount of paper feed and the like,and performs interlacing in which sorting is performed by dot patterndata to be printed per main-scanning unit (Step S160). When interlacingis performed, the CPU 40 sends dot data to the print head 90, drives thecarriage motor 70 and the paper feeding motor 74, and executes printing(Step S170).

(A3) Halftone Process:

The following is a detailed description of the halftone process (StepS130). In this description, the gradation value for each pixel is from 0to 255, and a larger gradation value indicates a darker color. FIG. 3 isa flowchart showing the flow of the halftone process. When this processhas been initiated, the CPU 40 first obtains the coordinate data n(x, y)at the position of the denoted pixel and the denoted pixel data Dn,which is the gradation value data for the denoted pixel, in the imagedata that was color-converted in Step S120 (Step S131). The CPU 40 usesthe region determination processor 43 to perform the regiondetermination process (Step S132) when the coordinate data n(x, y) atthe position of the denoted pixel and the denoted pixel data Dn havebeen obtained.

The region determination process (Step S132) will now be described indetail. In the region determination process performed in this example,it is determined whether or not the denoted pixel (x, y) is adarker-color pixel (referred to below as a higher-density edge pixel)among the pixels constituting an edge of the printed image (referred tobelow as edge pixels). More specifically, the gradation value of a pixelpositioned a certain distance D from the denoted pixel (where D is apositive integer) (referred to below as the pixels subject to adifference study) is subtracted from the gradation value of the denotedpixel, and it is determined whether the difference value is greater thana predetermined threshold value (referred to below as the edgedetermination threshold value EDGE_TH). The value of the distance D canbe established at various stages. It can be set in the design stage forthe printing apparatus, it can be set manually by the user in theprinting stage, or it can be set automatically by the printing apparatusduring the printing process on the basis of the characteristics of theimage data.

FIG. 4 is an explanatory diagram used to explain an example of theregion determination process in a case set to D=1. In a case set to D=1,the pixels subject to a difference study can be set to (x−1, y), (x+1,y), (x, y−1), and (x, y+1). In a case in which one of the following istrue,

date[x,y]−date[x−1,y]>EDGE_TH or

date[x,y]−date[x+1,y]>EDGE_TH or

date[x,y]−date[x,y−1]>EDGE_TH or

date[x,y]−date[x,y+1]>EDGE_TH

the denoted pixel (x, Y) is determined to be a higher-density edgepixel. Here, date [ . . . ] represents the gradation value for the pixelat the coordinates inside the bracket.

In this example, the denoted pixel is moved in the image data from aboveto below or from left to right in a case in which a predetermineddirection has been established as a standard for a printed image. Morespecifically, it is set in the positive direction for the viewer to viewthe printed image. When the denoted pixel is positioned in a corner ofthe image data, some of the pixels subject to a difference study do notexist. In such cases, dummy pixels are set for the non-existent pixelssubject to a difference study, and the region determination process isperformed in which the gradation value of the dummy pixels is the sameas the gradation value of the denoted pixel. In FIG. 4, the pixelshaving a high gradation value (referred to as high-gradation pixelsbelow) are expressed by dot shading, and the higher-density edge pixelsare expressed by cross-hatching.

In cases in which, for example, the distance is set to D=2, as shown inFIG. 5, pixels obtained by adding (x−2, y), (x+2, y), (x, y−2), (x,y+2), (x−1, y−1), (x+1, y−1), (x−1, y+1), and (x+1, y+1) as pixelssubject to a difference study to the pixels subject to a differencestudy at D=1 can be set as pixels subject to a difference study. As in acase in which D=1, the size is compared with the edge determinationthreshold value EDGE_TH to determine whether or not the denoted pixel isa higher-density edge pixel.

The CPU 40 sets a flag to “1” for denoted pixels determined to behigher-density edge pixels, and sets the flag to “0” for all otherpixels. The CPU 40 performs the region determination process in thisway.

The description will now return to the halftone process (FIG. 3). Afterthe region determination process has been performed, the CPU 40 performsa dot ON/OFF determination process in which it is determined whether ornot dots are formed for each pixel on the basis of the results of theregion determination process (Step S140). The dot ON/OFF determinationprocess is described in greater detail below. The correction data dataXand the binarization result values rs calculated in this process arethen used to calculate binarization errors En (Step S160). After thebinarization errors En have been calculated, the CPU 40 distributes thebinarization errors En as diffusion errors Edn at a ratio of 7/16 withrespect to the pixels to the right of the denoted pixel, 3/16 withrespect to the pixels to the lower left, 5/16 with respect to the pixelsbelow, and 1/16 with respect to the pixels to the lower right, which areall surrounding pixels for which dot ON/OFF has not been decided (StepS161). The processing from Step S131 to Step S161 is performed on all ofthe pixels in the image data while moving the denoted pixel from left toright and from above to below with respect to the printed image (seeFIG. 4) (Step S162).

The following is a description of the dot ON/OFF determination process(FIG. 3: Step S140). FIG. 6 is a flowchart showing the flow of the dotON/OFF determination process. After the region determination process(FIG. 3: Step S132), the CPU 40 adds diffusion errors Edn stored in aseparately provided error buffer to the gradation values of the denotedimage data Dn to calculate correction data dataX (Step S140). Thediffusion errors Edn are calculated in Step S160 of the halftone processfor the other pixels.

After the correction data dataX has been calculated, the CPU 40determines whether or not the denoted pixel is an edge pixel on thebasis of the flag set in the region determination process mentionedabove. In a case in which the denoted pixel is an edge pixel (Step S142:YES), the central processor functions as an error diffusion methodprocessor 45 and compares the correction data dataX and the errordiffusion threshold value ED_th used in the halftone process that isbased on the error diffusion processing method (for example, 128). Theerror diffusion threshold value ED_th is stored in advance in the EEPROM60 (not shown). When, as a result of the comparison of the correctiondata dataX and the error diffusion threshold value ED_th, the correctiondata dataX is greater (Step S144: YES), it is decided that a dot isturned ON at the denoted pixel, and the binarization result value is setto rs=255 (Step S145). When the correction data dataX is equal to orless than the error diffusion threshold value ED_th (Step S143: NO), itis decided that a dot is turned OFF at the denoted pixel, and thebinarization result value is set to rs=0 (Step S146).

In cases in which the denoted pixel is a pixel other than an edge pixel(Step S142: NO), the CPU 40 functions as an error diffusion methodprocessor 45 and compares the denoted pixel data Dn with a ditherthreshold value TH_th, which is the threshold value corresponding to thedenoted pixel data Dn among the gradations constituting the dither mask61 stored in the EEPROM 60 (Step S144). When, as a result of thecomparison, the denoted pixel data Dn is greater than the ditherthreshold value TH_th (Step S144: YES), it is decided in the CPU 40 thata dot is turned ON at the denoted pixel, and the binarization resultvalue is set to rs=255 (Step S145). When, as a result of the comparison,the denoted pixel data Dn is less than the dither threshold value TH_th(Step S144: NO), it is decided that a dot is turned OFF at the denotedpixel, and the binarization result value is set to rs=0 (Step S146). TheCPU 40 performs the dot ON/OFF determination process in this way. Incases in which the denoted pixel is in a corner of the image in StepS143, there is no distribution of diffusion errors Edn from thesurrounding pixels. In these cases, the relation Edn=0 is satisfied, andthe denoted pixel data Dn is compared with the error diffusion thresholdvalue ED_th. The aforementioned has been a description of the flow ofthe halftone process performed by the CPU 40.

FIG. 7 is an explanatory diagram summarizing the characteristics of thehalftone process. The effects of the present example will be describedusing FIG. 7. As described above, when the printer 20 performs thehalftone process, the dot ON/OFF decision for the edge pixels(higher-density edge pixels in the example) is performed using the errordiffusion method. The dot ON/OFF decision for pixels other than the edgepixels is performed using the dither method. Because the error diffusionmethod has superior resolution and gradation reproducibility, the errordiffusion method is applied to the edge pixels, especially thehigher-density edge pixels in this example, to perform the halftoneprocess, whereby text, line drawings, and the like composed oflow-gradation fine lines in the printed image are less likely to bebroken, and fine lines can be reproduced with precision.

Meanwhile, because the printer 20 makes a dot ON/OFF decision using thedither method in cases in which the halftone process is performed onpixels other than edge pixels (higher-density edge pixels in thisexample), deterioration in image quality due, for example, to landingposition slippage of ink dots can be suppressed by endowing the dithermask being used with predetermined conditions. In this way, the printer20 can divide the image data to be printed into predetermined regions,and apply the effective processing method for each region, whether it isthe error diffusion method or the dither method, to make dot ON/OFFdecisions.

Also, in the boundary for switching from a region in which dot ON/OFF isdecided using the dither method (a dither method region) to a region inwhich dot ON/OFF is decided using the error diffusion method (an errordiffusion method region), binarization errors in the dither methodregion are distributed to the error diffusion method region as diffusionerrors. As a result, dot generation occurs continuously and smoothly inthe boundary between a dither region and an error diffusion methodregion, and artificial contours are less likely to occur in the printedimage due to a switch in the halftone process method.

In this example, the target of the comparison with the threshold valuesof the dither mask is the gradation values of the denoted pixels whendot ON/OFF is decided in regions where the halftone process is performedusing the dither method. Error diffusion is performed in accordance withthe error diffusion method, but the target of the comparison with thethreshold values of the dither mask is not the correction data dataX,but the gradation value of the denoted pixel (denoted pixel data Dn). Inthis way, dot ON/OFF decisions can be made so as to sufficiently reflectthe predetermined characteristics of the dither mask (dispersibility,periodicity, and the like).

In commonly used halftone process techniques combining the dither methodand the error diffusion method, the threshold values of the dither maskare used in the error diffusion method. In these halftone processtechniques, the target of the comparison with the threshold values ofthe dither mask is correction data composed of the gradation value ofthe denoted pixel and the diffusion error distributed from thesurrounding pixels. When dot ON/OFF decisions are made by comparingcorrection data and the threshold values of the dither mask, a problemis encountered in that the characteristics inherently provided to thedither mask (dispersibility, characteristics for inhibiting theprominence of ink landing position slippage, and the like) areinhibited. This problem is solved because the target of comparison withthe threshold values of the dither mask is the gradation value of thedenoted pixel in the halftone process performed in this example, asdescribed above.

As for the correspondence between this example and the claims, theregion determination processor 43 corresponds to the region-dividingprocessor in the claims, the process performed in Step S143 of the dotON/OFF determination process (FIG. 3) is the process performed by thecomparator in the claims, the process performed in Steps S143 throughS145, S146, and S160 and S161 of the dot ON/OFF determination process(FIG. 3) is the process performed by the first dot-decision processor inthe claims, and the process performed in Steps S144 and S145, S146, andS160 and S161 of the dot ON/OFF determination process (FIG. 3) is theprocess performed by the second dot-decision processor in the claims.

B. 2nd Example:

The following is a description of the second example. A point ofdifference in the configuration of the printer 20 a with respect to theprinter 20 in the first example is that the halftone processor 42 isequipped with a comparator 47 and an error diffusion unit 48 instead ofthe dither method processor 44 and the error diffusion method processor45 in the first example. The rest of the configuration of the printer 20a is identical to that of the printer 20 in the first example. Thefollowing is a detailed description of the comparator 47 and the errordiffusion unit 48. Also, the printing process in the second examplediffers from the first example only in the dot ON/OFF determinationprocess in the halftone process. The general flow of the printingprocess and the halftone process described in FIGS. 2 and 3 is the same.Therefore, the description corresponding to FIGS. 2 and 3 has beenomitted.

The following is a description of the flow of the dot ON/OFFdetermination process in the second example. FIG. 8 is a flowchartshowing the flow of the dot ON/OFF determination process in the secondexample. When this process is initiated, the CPU 40 determines whetheror not the denoted pixel is an edge pixel (a higher-density edge pixelin this example) on the basis of the flag set in the regiondetermination process (Step S241). When the CPU 40 has determined thatthe denoted pixel is a higher-density edge pixel (Step S241: YES), thethreshold-value increase/decrease parameter th_add for the denotedpixel, which is a parameter used in subsequent processing, is decided tobe “0” (Step S242). When the CPU 40 has determined that the denotedpixel is not a higher-density edge pixel (Step S241: NO), thethreshold-value increase/decrease parameter th_add for the denoted pixelis decided to be “64” (Step S243).

After the threshold-value increase/decrease parameter th_add has beendecided for each denoted pixel, the CPU 40 performs a provisionaldithering process (Step S244) as a process of the comparator 47. In thisprovisional dithering process, the size of the gradation value for thedenoted pixel data Dn is compared with the dither threshold value TH_thcorresponding to the denoted pixel data Dn among the threshold valuesconstituting the dither mask 61 stored in the EEPROM 60. Formally, thisprocess is the same as a dot ON/OFF determination commonly performedusing the dither method. In effect, in the common dither method, a dotis determined to be ON when the gradation value of the denoted pixeldata Dn is equal to or greater than the dither threshold value TH_th,and a dot is determined to be OFF when the gradation value of thedenoted pixel data Dn is less than the dither threshold value TH_th.However, the provisional dithering process of this example differs inthat it is a preliminary process for making a dot ON/OFF decision usingthe error diffusion method described below. More specifically, it is aprocess for deciding the threshold value for the error diffusion method.

When, as a result of the provisional dithering process, the gradationvalue of the denoted pixel data Dn is equal to or greater than thedither threshold value TH_th (Step S244: YES), the threshold value THeused in the error diffusion method is set to the low threshold valueTHe_L (Step S245). When the low threshold value THe_L has been set, theCPU 40 subtracts the threshold-value increase/decrease parameter th_adddecided in the preceding processing from the reference error diffusionthreshold value EDTH set in advance (for example, 128), and thedifference value is set as the low threshold value THe_L. For example,in cases in which the denoted pixel is a higher-density edge pixel, thethreshold-value increase/decrease parameter th_add is zero, and istherefore calculated as a low threshold value THe_L=EDTH−0. In cases inwhich the denoted pixel is a higher-density edge pixel, thethreshold-value increase/decrease parameter th_add=64, and is thereforecalculated as a low threshold value THe_L=EDTH−64.

When, as a result of the provisional dithering process, the gradationvalue of the denoted pixel data Dn is less than the dither thresholdvalue TH_th (Step S244: NO), the threshold value THe used in the errordiffusion method is set to the high threshold value THe_H (Step S246).When the high threshold value THe_H has been set, the CPU 40 adds thethreshold-value increase/decrease parameter th_add decided in thepreceding region determination process to the reference error diffusionthreshold value EDTH set in advance (for example, 128), and the sumvalue is set as the high threshold value THe_H. For example, in cases inwhich the denoted pixel is a higher-density edge pixel, thethreshold-value increase/decrease parameter th_add is zero, and istherefore calculated as a high threshold value THe_H=EDTH+0. In cases inwhich the denoted pixel is a higher-density edge pixel, thethreshold-value increase/decrease parameter th_add=64, and is thereforecalculated as a high threshold value THe_H=EDTH+64. Thus, in thisconfiguration, the threshold value THe used in the error diffusionmethod is changed based on the result of the provisional ditheringprocess.

When the threshold value THe has been set, the CPU 40 adds the diffusionerror Edn prepared in advance and stored in the error buffer to thegradation value of the denoted pixel data Dn, and calculates thecorrection data dataX (Step S247). Because the calculation method forthe diffusion error Edn used here is the same as the one used in thefirst example, further description has been omitted.

When the diffusion error Edn has been added to the gradation value ofthe denoted pixel data Dn, the CPU 40 compares the correction data dataXto the threshold value THe set in Step S245 or Step S246 (Step S248). Asa result, when the correction data dataX is equal to or greater than thethreshold value THe (Step S248: YES), a dot ON decision is made for thedenoted pixel, and the binarization result value is set to rs=255 (StepS249). When the gradation value of the denoted pixel data Dn to whichthe diffusion error Edn has been added is less than the threshold valueTHe (Step S248: NO), a dot OFF decision is made for the denoted pixel,and the binarization result value is set to rs=0 (Step S250). The CPU 40performs the dot ON/OFF decision processing in this way. The halftoneprocess following the dot ON/OFF determination process is the same asthe process performed in the first example (Step S160 and thereafter inFIG. 3), so further description has been omitted.

When a dot ON/OFF decision has been made, the CPU 40 calculates thebinarization errors En by subtracting the binarization result value rsfrom the correction data dataX (Step S248). The diffusion errors Edn arethen calculated in the same manner as the first example (Step S249). Inthis example as well, the binarization errors En are distributed asdiffusion errors Edn at a ratio of 7/16 with respect to the pixels tothe right of the denoted pixel, 3/16 with respect to the pixels to thelower left, 5/16 with respect to the pixels below, and 1/16 with respectto the pixels to the lower right, which are all surrounding pixels forwhich dot ON/OFF has not been decided. The diffusion errors Edncalculated in this manner are stored in the error buffer. In the dotON/OFF determination process of this example, the binarization is onlyperformed to make dot ON/OFF decisions. However, a multi-value processcan also be performed to make ON/OFF decisions for large dots and smalldots.

The basic principles of this halftone process will now be describedusing FIG. 9. FIG. 9 is an explanatory diagram summarizing thecharacteristics of the halftone process in the second example. In theprocess performed in Steps S244 through S246, as described above, incases in which the gradation value of the denoted pixel data Dn is equalto or greater than the dither threshold value TH_th, that is, when aprovisional process has been performed using the dither method, thethreshold value THe used in the error diffusion method is set to the lowthreshold value THe_L if the dots are ON; and in cases in which thegradation value of the denoted pixel data Dn is less than the ditherthreshold value TH_th, that is, when a provisional process has beenperformed using the dither method, the threshold value THe is set to thehigh threshold value THe_H if the dots are OFF.

Here, a case will be considered in which the threshold difference valueΔTHe is defined as THe_H−THe_L and the threshold difference value ΔTHeis “0”, that is, a case will be considered in this example in which thedenoted pixel is a higher-density edge pixel (threshold-valueincrease/decrease parameter th_add=0). Because the results of theprovisional dithering process have an effect on the threshold value THein this case, the processing in Steps S244 through S246 is notmeaningful with respect to the final dot ON/OFF decision made using theerror diffusion method (Steps S248-S250). This means that the final dotON/OFF decision is made using only an error diffusion method element inthe halftone process performed in Step S130 (see FIG. 2). In FIG. 9, theerror diffusion method element serving as a dot data characteristic islarge.

Next, a case will be considered in which the threshold difference valueΔTHe is greater than 0 (THe_H>THe_L), that is, a case will be consideredin this example in which the denoted pixel is a pixel other than ahigher-density edge pixel (threshold-value increase/decrease parameterth_add=64). In this case, when the CPU 40 makes a dot ON determinationin the provisional dithering process (the gradation value of the denotedpixel data Dn is equal to or greater than the dither threshold valueTH_th), the threshold value THe is set to the relatively small lowthreshold value THe_L. When the CPU 40 makes a dot OFF determination inthe provisional dithering process (the gradation value of the denotedpixel data Dn is less than the dither threshold value TH_th), thethreshold value THe is set to the relatively large high threshold valueTHe_H. In other words, when the CPU 40 has made a dot ON determinationusing the provisional dithering process, controls are performed tofacilitate a dot ON decision using the error diffusion method. When adot OFF determination has been made using the provisional ditheringprocess, controls are performed to facilitate a dot OFF decision usingthe error diffusion method. This means that, compared with a case inwhich the threshold difference value ΔTHe is zero, the final dot ON/OFFdetermination result in the error diffusion method is closer to the dotON/OFF determination result in the provisional dithering process. Inother words, the final dot ON/OFF determination is made by adding adither method element to the error diffusion method element. In FIG. 9,the dither method element serving as a dot data characteristic is large.

In sum, the relative contribution of the dither method element and theerror diffusion method element to the halftone process can be controlledby changing the threshold value THe; more specifically, changing thesize of the threshold difference value ΔTHe, based on the results of theprovisional dithering process. In this example, these principles areused to dynamically control the dither method element and the errordiffusion method element in the halftone process on the basis of whetheror not the denoted pixel is a higher-density edge pixel. This can beinterpreted as being able to allow the extent of control aimed atfacilitating dot formation by using the error diffusion method to becontrolled based on the size of the threshold difference value ΔTHe.

As described above, when dot data is generated in accordance with theerror diffusion method by a printer 20 a thus configured, the resultsfrom the provisional dithering process are used to control the ease withwhich dots are formed using the error diffusion method. In other words,the dot ON/OFF determination results obtained on the assumption that thedither method was used are used to control the ease with which dots areformed by the error diffusion method. Therefore, the halftone processcan be performed in which a dither method element and an error diffusionmethod element have been incorporated.

More specifically, in a case in which the results of the provisionaldithering process performed by the printer 20 a are dot ON, thethreshold value THe used in the error diffusion method is set to the lowthreshold value THe_L, and control is performed so that dots are easierto form by the error diffusion method. When the results of theprovisional dithering process are dot OFF, the threshold THe is set tothe high threshold value THe_H, and control is performed so as to makeit more difficult to form dots by the error diffusion method. In eithertype of control, the presence or absence of dot formation is closer tothe results from the dither method than to dot data from the simpleerror diffusion method. As a result, the dither method element isenhanced. Therefore, by setting the extent of these controls, that is,the threshold difference value ΔTHe, and the size of the threshold-valueincrease/decrease parameter th_add in this example, it is possible toset the appropriate contribution of the dither method element and theerror diffusion method element to the halftone process. Also, becausethe ease with which dots are formed using the error diffusion method iscontrolled simply by changing the threshold value THe on the basis ofthe results of the provisional dithering process, the configuration issimple and the processing is faster.

Also, the printer 20 a in this example changes the threshold differencevalue ΔTHe on the basis of whether each of the pixels that form theimage being printed is a higher-density edge pixel. More specifically,the printer is configured so that in a case in which the denoted pixelis a higher-density edge pixel, the error diffusion method element inthe halftone process is enhanced by increasing the threshold differencevalue ΔTHe, and in a case in which the denoted pixel is not ahigher-density edge pixel, the dither method element in the halftoneprocess is enhanced.

The halftone process based on the error diffusion method has superiorreproducibility both of resolution and of gradient elements. Therefore,in a case in which the image being printed contains fine lines renderedin low density (for example, characters or a rendered line drawing), thefine lines can be reproduced with precision and without breaking whenthe error diffusion method is applied to the pixels constituting thecontours of the fine lines and to surrounding pixels.

The halftone process based on the dither method can inhibitdeterioration in image quality due to the slippage of the landingposition of ink dots by endowing the dither mask used with predeterminedcharacteristics. Also, the execution speed during the halftone processis not affected even when the dither mask itself is generated so as tohave advanced characteristics. Thus, from the standpoint of inhibitingimage quality deterioration due to landing position slippage and fromthe standpoint of processing speed, the halftone process based on thedither method is very effective for the solid regions of an image beingprinted.

In this example, the error diffusion method element was enhanced and ahalftone process was performed to improve reproducibility of fine linesfor the higher-density edge pixels of an image being printed, and thedither method element was enhanced and a halftone process was performedto increase the processing speed and to prevent image qualitydeterioration due to the slippage of the landing positions of ink dotsin all other regions. In other words, by enhancing the error diffusionmethod element in the regions of image data to be printed in which themerits of the error diffusion method outweigh the merits of the dithermethod, enhancing the dither method element in regions in which themerits of the dither method outweigh the merits of the error diffusionmethod, and then performing a halftone process, a printed image can beobtained in which the fine lines in the printed image have superiorreproducibility, and in which image quality deterioration due to ink dotlanding position slippage is inhibited.

Also, a printed image having adequate fine line reproducibility can beobtained even when a halftone process is performed in which the errordiffusion method element is enhanced both for higher-density edge pixelsand for lower-density pixels (referred to below as lower-density edgepixels) among the edge pixels constituting an edge in the image beingprinted. This example is configured so that the error diffusion methodelement is enhanced and a halftone process is performed only for thehigher-density edge pixels. In other words, the processing speed can beincreased by reducing the region of the halftone process in which theerror diffusion method element is enhanced, and which requires time forprocessing.

In this example, a dither mask was used in the same manner as the firstexample except that the target of the comparison with the thresholdvalues of the dither mask was the gradation value of the denoted pixelrather than the correction data dataX. In other words, the predeterminedcharacteristics of the dither mask (dispersibility, periodicity, and thelike) can be sufficiently reflected in the dither method elementexpressed in the dot data.

C. Modifications:

The invention is by no means limited to these examples and embodiments.The invention can be embodied in different ways, provided there is nodeviation from the essence of the invention. For example, the followingmodifications can be made.

(C1) Modification 1:

In the examples, the region determination process was performed bydividing the edge pixels (the higher-density edge pixels in the firstand second examples) from the other pixels. However, other divisionmethods can be used.

Here, the pixels provided to the process in Step S143 (FIG. 6) of thefirst example, that is, the pixels for which the dot ON/OFF decision ismade by comparing the correction data dataX and the error diffusionthreshold value ED_th, and the pixels provided to the process in whichthe error diffusion method element in the second example is enhanced,are referred to as pixels which are collectively provided to the errordiffusion method process. Also, the pixels provided to the process inStep S144 (FIG. 6) of the first example, that is, the pixels for whichthe dot ON/OFF decision is made by comparing the denoted pixel data Dnand the dither threshold value TH_th, and the pixels provided to theprocessing in which the dither method element in the second example arepixels is enhanced, are referred to as pixels collectively provided tothe dither method process.

When defined in this manner, the division method in the regiondetermination process can, for example, divide each pixel in the imagedata into a character region constituting text, a fine-line regionconstituting fine lines, and another region. Here, the character regionand the fine-line region are processed as pixels provided to the errordiffusion method process, and the other pixels are processed as pixelsprovided to the dither method process. When the division and processingare performed in this way, it is possible to obtain a printed image thathas superior reproducibility of contours in the character region and thefine-line region due to the characteristics of the error diffusionmethod (dispersibility, continuity), and that has the superiorcharacteristics of the dither method or the predeterminedcharacteristics of the dither mask in the other region (for example,characteristics for inhibiting the prominence of ink landing positionslippage). When the image data to be printed is test data, regiondetermination can be performed as a region determination method in thiscase by setting different flags for pixels in the text portion andpixels in the other portions in the text data stage.

Also, among pixels constituting a line drawing, the pixels constitutingthe outer edge of the line drawing can be processing using an errordiffusion method process, and the pixels constituting the inside of theline drawing can be processed using a dither method process. In thiscase, the pixels outside of the line drawing are processed, for example,using the dither method. Performing the process in this manner makes itpossible to obtain a printed image having superior reproducibility ofthe contours in the line drawing.

In addition, the outer edge pixels of the line drawing can be processedby the error diffusion method process. Among the other pixels, thepixels near those processed using the error diffusion method process canbe processed by the dither method process, that is, error diffusion isperformed. The rest of the pixels are processed using the general dithermethod process. In other words, a process can be carried out in which acomparison is made between the gradation value of the denoted pixel andthe threshold value in the dither mask, a dot ON/OFF decision is made,and error diffusion is not performed. In processes performed using thegeneral dither method, a dot ON/OFF decision can be made relativelyeasily through a simple comparison with the threshold value. Theprocessing speed can therefore be increased by providing a region inwhich the processes are performed by the general dither method.

In addition, pixels in a region of image data having more noise in thehigh-frequency components than a predetermined value can be processed bythe error diffusion method process, and the pixels of the other region(a region with less noise in the high-frequency components) can beprocessed by the dither method process. This can inhibit imagedeterioration due to interference between the period of the dither maskand the period of the high-frequency components. Regions of considerablenoise from high-frequency components and regions of low noise fromhigh-frequency components can be divided by pre-scanning the image datato be printed before the halftone process, and dividing the regions by apredetermined method. For example, discrete cosine transform (DCT) canbe used to convert the image data to the size of the frequencycomponents, and the image data can be divided into regions thereby.

(C2) Modification 2:

In Modification 2, the dot ON/OFF determination process can be performedby combining the dot ON/OFF determination process in the first exampleand the dot ON/OFF determination process in the second example. Forexample, the dot ON/OFF determination process (FIG. 6) described in thefirst example can be applied to regions of pixels suitable for errordiffusion method processing, such as regions of edge pixels, characterregions, and thin line regions; and the dot ON/OFF determination process(FIG. 8) described in the second example can be applied to regionssuitable for dither method processing. Conversely, the dot ON/OFFdetermination process described in the second example can be applied toregions of pixels suitable for error diffusion method processing, andthe dot ON/OFF determination process described in the first example canbe applied to regions suitable for dither method processing.

(C3) Modification 3:

In the examples, a halftone process based on processing by the errordiffusion method was performed on all the edge pixels, including thoseto the left and right and those that are up and down, in theline-drawing region (in the first and second examples these edge pixelswere the higher-density edge pixels). However, a halftone process basedthe error diffusion method process can be performed on only one side ofthe edge. In other words, a halftone process based on processing by theerror diffusion method is performed only on the left or right edgepixels in a left-right edge, or only on the upper or lower edge pixelsin an up-down edge. In this case, setting the pixels subject to adifference study in the manner shown in FIGS. 10 and 11 allows ahalftone process to be performed in which the error diffusion methodelement is enhanced only in the higher-density edge pixels in one sideof a line drawing. Because dots are thus generated in a low-density thinline near the edge in which the error diffusion method element has beenenhanced, printing can be performed with superior thin linereproducibility and without any break in the thin line.

(C4) Modification 4:

In the examples, a halftone process based on processing by the errordiffusion method was performed on the higher-density edge pixels.However, the invention is not limited to this option alone. A halftoneprocess based on processing by the error diffusion method can beperformed on edge pixels that include lower-density edge pixels. Forexample, in a case in which the distance D=1 (see FIG. 4), the pixelssubject to a difference study are set as (x−1, y), (x+1, y), (x, y−1),and (x, y+1).

|date[x,y]−date[x−1,y]|>EDGE_TH or

|date[x,y]−date[x+1,y]|>EDGE_TH or

|date[x,y]−date[x,y−1]|>EDGE_TH or

|date[x,y]−date[x,y+1]|>EDGE_TH

These settings allow the process to be realized by determining whetherthe denoted pixel (x, Y) is an edge pixel. The error diffusion methodelement is enhanced in an edge pixel detected in this manner, and ahalftone process is performed. In this way, a printing process havingsuperior reproducibility for low-density thin lines can be performed.

(C5) Modification 5:

In the examples and modifications, the means for detecting edge pixelswas to detect the size of the difference in gradation between thedenoted pixel and the pixels subject to a difference study. However, theinvention is not limited to this option alone. For example, in cases inwhich the data to be processed for printing is vector data or text data,pixels in text and line drawings are obvious. Processing inputted dataso that a flag is attached to pixels in a text or line-drawing regionmakes it possible to detect the pixels forming the contours, that is,the edge pixels with ease. By detecting the edge pixels in this manner,the processing can be performed more rapidly.

(C6) Modification 6:

In the halftone process of the examples described above, the gradationvalue of a denoted pixel was compared with various types of thresholdvalues, and a dot ON/OFF decision was made. However, the gradation valueof the denoted pixel (denoted pixel data Dn) can be converted to arecording rate on the basis of a predetermined conversion rule, and acomparison can be made between the gradation value of the recording rateand various types of threshold values. The term “recording rate” refersto the ratio at which dots are recorded per pixel in an arbitraryregion. For example, in a case in which a printer 20, 20 a forms animage with a plurality of dot sizes, such as large dots and small dots,the various types of threshold values and the gradation value of therecording rate calculated per dot size can be compared with each otheron the basis of the denoted pixel data Dn.

(C7) Modification 7:

In the examples described above, the printer 20, 20 a performed theentire printing process shown in FIG. 2. However, in a case in which theprinting process is performed by a printing system in which a printerand computer (which constitute a printing apparatus in a broader sense)are connected with each other, some or all of the printing process andhalftone process can be performed by either the computer or the printer.

Examples of the invention were described above. However, the inventionis by no means limited to these examples. The invention can be embodiedin different ways provided there is no deviation from the essence of theinvention. For example, the invention is not limited to the serial-typeinkjet printer described in the examples above. It can also be appliedto other types of printing apparatus, such as an inkjet-type lineprinter or a laser printer. In addition, the invention does not have tobe configured as a printing apparatus. It can also be realized as aprinting method, program, or storage medium.

1. An image processing apparatus for processing image data having aplurality of pixels and expressing an image using a gradation value foreach pixel, the image processing apparatus comprising: an input unit forinputting the image data; a region-dividing processor for dividing theimage into at least a first region and a second region on the basis ofthe inputted image data; a comparator for comparing gradation values ofpixels in the first region and threshold values corresponding to thepixels of the first region of a dither mask having a plurality ofthreshold values; a first dot-decision processor for deciding whether ornot dots are formed in pixels of the first region among first boundarypixels, which are pixels in the first region near the boundary betweenthe first region and the second region, using information on pixelsincluded in the first region and not using information on pixelsincluded in the second region; a second dot-decision processor fordeciding whether or not dots are formed in pixels of the second regionamong some of the pixels in the second region, using information onpixels included in the first region and information on pixels includedin the second region; and a dot data generator for generating dot datafor the image data using formation or non-formation of dots as decidedby the first and second dot-decision processors.
 2. The image processingapparatus of claim 1, wherein the first dot-decision processor adds thediffusion errors distributed from the processed pixels near the firstboundary pixels to the gradation values of the first boundary pixels,calculates the first corrected gradation values, and references at leastthe comparison results to decide whether or not dots are formed inpixels of the first region, and then calculates errors between the firstcorrected gradation values and the first decision result values, whichare values corresponding to density expressed by the pixels in theresults of decisions among the first boundary pixels, and distributesthe errors as diffusion errors to unprocessed pixels near the firstboundary pixels.
 3. The image processing apparatus of claim 1, whereinthe second dot-decision processor calculates second corrected gradationvalues in which diffusion errors distributed from processed pixels amongsome of the pixels in the second region in an adjacent area thatincludes the first boundary pixels have been added to the gradationvalues of the pixels, compares the second corrected gradation values anda predetermined threshold value to decide whether or not dots areformed, calculates errors between the second corrected gradation valuesand second decision result values, which are values corresponding todensity expressed by the pixels in the results of the decisions, anddistributes the errors as diffusion errors to pixels in an adjacentarea.
 4. The image processing apparatus of claim 1, wherein theregion-dividing processor divides the image that comprises the pluralityof pixels so that the region that satisfies predetermined conditions fora region suitable for processing by the dither method becomes the firstregion, and the region that satisfies predetermined conditions for aregion suitable for processing by the error diffusion method becomes thesecond region.
 5. The image processing apparatus of claim 1, wherein thefirst dot-decision processor decides, as a result of the comparison,that dots are formed in cases in which the gradation value of a pixel inthe first region is greater than the threshold value corresponding to apixel in the first region of the dither mask, and that dots have notbeen formed in cases in which the gradation value is less than thethreshold value.
 6. The image processing apparatus of claim 1, whereinthe first dot-decision processor compares a predetermined determinationvalue and third corrected gradation values in which diffusion errorsdistributed from processed pixels among some of the pixels in an areaadjacent to the first region have been added to the gradation values ofthe pixels, and decides whether or not dots are formed, and, as a resultof the comparison by the comparator, adjusts the determination valueswithin a predetermined width so that the determination value applied incases in which the gradation value of a pixel in the first region isgreater than the threshold value corresponding to a pixel in the firstregion of the dither mask does not exceed the determination valueapplied in cases in which the gradation value of a pixel in the firstregion is equal to or less than the threshold value corresponding to apixel in the first region of the dither mask.
 7. The image processingapparatus of claim 1, wherein the second dot-decision processor decideswhether or not dots are formed by the error diffusion method, using anerror diffusion threshold value prepared in advance as a threshold valueused in the error diffusion method.
 8. The image processing apparatus ofclaim 1, wherein the first region is a region composed of pixels withoutedge pixels, edge pixels being pixels constituting an edge havinggradation value whose difference with respect to an adjacent pixel isequal to or greater than a predetermined value, and wherein the secondregion is a region composed of the edge pixels.
 9. The image processingapparatus of claim 1, wherein the second region is a thin-line orcharacter region included in an image.
 10. The image processingapparatus of claim 1, wherein the first region is a region composed ofinner pixels, which are pixels other than outer edge pixels constitutingan outer edge of a line drawing, among the pixels constituting the linedrawing included in the image, and wherein the second region is a regioncomposed of the outer edge pixels.
 11. The image processing apparatus ofclaim 1, wherein the first region is a region having less noise inhigh-frequency components than a predetermined value, and wherein thesecond region is a region having more noise in the high-frequencycomponents than the predetermined value.
 12. A printing apparatus forperforming a printing operation on the basis of image data having aplurality of pixels and expressing an image using a gradation value foreach pixel, the printing apparatus comprising: an input unit forinputting the image data; a region-dividing processor for dividing theimage into at least a first region and a second region on the basis ofthe inputted image data; a comparator for comparing gradation values ofpixels in the first region and threshold values corresponding to thepixels of the first region of a dither mask having a plurality ofthreshold values; a first dot-decision processor for adding thediffusion errors distributed from processed pixels near the firstboundary pixels to the gradation values of the first boundary pixels inthe first boundary pixels, which are pixels in the first region near theboundary between the first region and the second region, calculating thefirst corrected gradation values, and referencing at least thecomparison results to decide whether or not dots are formed in pixels ofthe first region, and then calculating errors between the firstcorrected gradation values and the first decision result values, whichare values corresponding to density expressed by the pixels in theresults of decisions among the first boundary pixels, and distributingthe errors as diffusion errors to unprocessed pixels near the firstboundary pixels; a second dot-decision processor for calculating secondcorrected gradation values in which diffusion errors distributed fromprocessed pixels among some of the pixels in the second region in anadjacent area that includes the first boundary pixels have been added tothe gradation values of the pixels, comparing the second correctedgradation values and a predetermined threshold value to decide whetheror not dots are formed, calculating errors between the second correctedgradation values and second decision result values, which are valuescorresponding to density expressed by the pixels in the results of thedecisions, and distributing the errors as diffusion errors to pixels inan adjacent area; a dot data generator for generating dot data for theimage data using formation or non-formation of dots as decided by thefirst and second dot-decision processors; and a printing unit forperforming a printing operation on the basis of the dot data.
 13. Animage processing method for processing image data having a plurality ofpixels and expressing an image using a gradation value for each pixel,the image processing method comprising: inputting the image data;dividing the image into at least a first region and a second region onthe basis of the inputted image data; comparing gradation values ofpixels in the first region and threshold values corresponding to thepixels of the first region of a dither mask having a plurality ofthreshold values; adding the diffusion errors distributed from processedpixels near the first boundary pixels to the gradation values of thefirst boundary pixels, the first boundary pixels being pixels in thefirst region near the boundary between the first region and the secondregion, calculating the first corrected gradation values, andreferencing at least the comparison results to decide whether or notdots are formed in pixels of the first region, and then calculatingerrors between the first corrected gradation values and the firstdecision result values, which are values corresponding to densityexpressed by the pixels in the results of decisions among the firstboundary pixels, and distributing the errors as diffusion errors tounprocessed pixels near the first boundary pixels; calculating secondcorrected gradation values in which diffusion errors distributed fromprocessed pixels among some of the pixels in the second region in anadjacent area that includes the first boundary pixels have been added tothe gradation values of the pixels, comparing the second correctedgradation values and a predetermined threshold value to decide whetheror not dots are formed, calculating errors between the second correctedgradation values and second decision result values, which are valuescorresponding to density expressed by the pixels in the results of thedecisions, and distributing the errors as diffusion errors to pixels inan adjacent area; and generating dot data for the image data usingformation or non-formation of dots as decided by the first and seconddot-decision processors.